package sui.template
{
    import flash.system.ApplicationDomain;

    public class ConstExp implements IExpression
    {
        private var res:*;

        public function ConstExp(str:String)
        {
            var indexOfLastDot:int = str.lastIndexOf(".");
            var className:String = str.substr(0, indexOfLastDot);
            var propName:String = str.substr(indexOfLastDot + 1);
            var obj:Object = ApplicationDomain.currentDomain.getDefinition(className);
            res = obj[propName];
        }

        public function exec(context:Object):*
        {
            return res;
        }
    }
}
